﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.SceneManagement;

public class GameMgr : Singleton<GameMgr>
{
    GameObject _engineRoot;
    public void Init()
    {
        if (_engineRoot == null)
        {
            _engineRoot = new GameObject("GameEngine");
            GameObject.DontDestroyOnLoad(_engineRoot);
            _engineRoot.AddComponent<GameEngine>();
        }

        UIManager.instance.Init();
        QuickCoroutine.instance.Init();
        // 

        // 启动游戏引擎
        // 跳转第一个逻辑界面
        SceneManager.LoadScene("Login");
        UIManager.instance.Replace("UI/Login/Login", UILayer.Normal);
    }
}
